from Plotter import *
import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号

if __name__ == '__main__':
    data_p = [[1, 2], [3, 4], [5, 6]]
    data2 = [[2, 5, 8, 1], [3, 6, 10, 4]]
    data3 = [[1, 2, 3, 5], [2, 5, 8, 1], [4, 5, 6, 7]]
    data4 = [[1, 2, 3, 5], [2, 5, 8, 1], [3, 6, 10, 4], [4, 5, 6, 7]]
    path = r"D:\Python\ModernProgramming\Filter\Resource"
    it = "jpg"
    audio_path = r"D:\Python\ModernProgramming\Adaptor_Model\Resource\bhk_med.wav"

    p = PointPlotter(data_p)
    p.plot()
    input("点绘制测试完成，按回车键继续")

    a = ArrayPlotter(data2)
    a.plot()
    input("二维数组绘制测试完成，按回车键继续")

    a = ArrayPlotter(data3)
    a.plot()
    input("三维数组绘制测试完成，按回车键继续")

    a = ArrayPlotter(data4)
    a.plot()
    print("高维数组PCA绘制测试完成，测试结束")

    with open("BIG_E.txt", "r", encoding="utf8") as m:
        t = TextPlotter(m.read())
        t.plot()
    input("词云绘制测试完成，按回车键继续")

    i = ImagePlotter(path, it, 3, 2, (100, 100))
    i.plot()
    input("图片展示绘制测试完成，按回车键继续")

    g = GifPlotter(path, it, 100, 100)
    g.plot("gif_test", 0.5)
    input("图片合成GIF测试完成，按回车键继续")

    au = AudioPlotter(audio_path)
    au.plot()
    input("音频可视化绘制测试完成，按回车键继续")
